home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / xreversi / xreversi.txt < prev   
Text File  |  1995-12-10  |  7KB  |  162 lines

  1.     I decided to donate my "Extended Reversi" program to the public domain.
  2.     This program supports 8x8, 10x10, 16x16, and 20x20 board sizes.
  3.     The larger board sizes introduce an entire mid-game concept.
  4.     
  5.     The Visual Basic verson 3.0 source code is included within SOURCE.ZIP.
  6.     To run the executable, you will need a copy of VBRUN300.DLL on your
  7.     system.
  8.  
  9.     The author can be reached by electronic mail at:
  10.  
  11.       rrutt@delphi.com
  12.  
  13.     -- Rick
  14.        10-Dec-1995
  15.  
  16.  
  17. The game of Reversi
  18.  
  19. From "The Board Game Book", by R.C. Bell,
  20. (c) 1979 by Marshall Cavendish Limited
  21. ISBN 0 89535 007 6
  22. Library of Congress Catalog Card Number 79-84789
  23. The Knapp Press, publishers, Los Angeles
  24. distributed by The Viking Press, New York
  25.  
  26.   "Reversi was invented [in England] by Mr. Waterman in 1888 and
  27.    published by Messrs. Jacques and Son.  There were sixty-four
  28.    pieces, blue on one side and yellow on the other, colours
  29.    contrasting well with the standard nineteenth century black and
  30.    white Draughts/Checkers boards.  Reversi has recently enjoyed
  31.    renewed popularity under the name Othello."
  32.  
  33.    [And due to being delivered with Microsoft Windows V3.0 ...]
  34.  
  35. XReversi, by Rick Rutt, extends the game to allow larger boards
  36. (by using the computer to provide accuracy and convenience for
  37. large reversals).
  38.  
  39.  
  40. The original game had a special opening protocol:
  41.  
  42.   The board starts EMPTY.
  43.  
  44.   A playing piece is tossed (like a coin toss).
  45.   The winner of the toss elects to go 1st or 2nd.
  46.  
  47.   The 1st player places a piece (their color up) on ANY of the
  48.   four central squares.
  49.  
  50.   The 2nd player places another piece (their color up) on any of
  51.   the 3 remaining central squares.
  52.  
  53.   The 1st player places another piece (their color up) on either of
  54.   the 2 remaining central squares.
  55.  
  56.   The 2nd player places another piece (their color up) on the
  57.   last central square.
  58.  
  59. The XReversi program simulates this with a random outcome of
  60. the entire protocol.
  61.  
  62. The "modern" opening, taken from Gabriel's Othello (tm), starts
  63. with diagonally opposed player pieces on the four central squares.
  64.  
  65.   Play then continues:  the 1st player places a piece (their color up)
  66.   on any empty square adjacent to an opponent's piece, and flanked
  67.   in an unbroken line (of opponent pieces) by one of the player's
  68.   own pieces, either in a straight line or diagonally.  All such
  69.   flanked pieces are reversed (including any in other directions
  70.   that are also flanked).
  71.  
  72.   Play alternates.
  73.  
  74.   If a player does not have a legal move, they must forfeit the turn.
  75.  
  76.   If both players must forfeit successively, the game is over.
  77.   Otherwise, the game ends when the board is full.
  78.  
  79.   The player with the most pieces of their own color showing wins.
  80.  
  81.   (New player "handicapping"):  The weaker player wins a tie,
  82.   or the stronger player must win by a predetermined number of pieces.
  83.  
  84. (Above rules were adapted from R.C. Bell's book.)
  85.  
  86.  
  87.  
  88.     This version of the game has its own history:
  89.     
  90.     In about 1983, Guy Rind (of ADP Network Services) located a Dartmouth
  91.     Basic program that played Othello -- the computer simply went for the
  92.     most pieces reversed each turn.
  93.     
  94.     Guy added escape sequences so the program (when running on a
  95.     DECsystem-10) updated the X's and O's in-place on a VT-100 using
  96.     double-high/wide characters.  User input was still <row><col><return>
  97.     in response to a text prompt, such as "B5".
  98.     
  99.     I had been playing the board game version of Othello ((tm) of Gabriel)
  100.     with my brother, and had a personal tactical approach that did not
  101.     require "look ahead".  (I like the "visual gestalt" approach.)
  102.     I then added the position rating arrays to the program to emulate my
  103.     personal game style.
  104.     
  105.     In about 1984, I left ADP, so I retyped the game into a Texas
  106.     Instruments 99/4A home computer, using Extended Basic.
  107.     
  108.     In 1985, I modified the program to use the TI's "mosaic graphics"
  109.     features, and to use a joystick to point to the desired move square.
  110.     TI Basic was interpreted, and the interpreter used interpreted
  111.     pseudo-instructions in turn, so it was slow.  To provide distraction
  112.     while the computer "thought", the display highlighted each square as the
  113.     computer evaluated it.  After 1 or 2 MINUTES, it made a move.
  114.     
  115.     (To reward the patient player, all moves were recorded in an array, and
  116.     the end of the game was followed by an "instant replay" of the whole
  117.     game.  This ran quickly, since no "thought" was needed.)
  118.     
  119.     
  120.     In 1986 I bought a dual-floppy MS-DOS portable and a copy of Turbo
  121.     Pascal v3.0 -- I retyped the game in yet again, converting to Pascal
  122.     syntax.  Graphics were used, but no pointer.  Input was two successive
  123.     digit keys for the row and col (no <return> needed).
  124.     
  125.     Play was fast, so I made another version with a 10x10 board.
  126.     This adds a new "mid game" tactical stage to the game.
  127.  
  128.     (These versions are still useful on HP 95LX, 100LX and 200LX
  129.     MS-DOS palmtop computers, and can be obtained by anonymous FTP
  130.     from eddie.mit.edu in the directory /pub/hp95lx/NEW as a uuencoded
  131.     copy of a .ZIP file called hprvrsi.uue (as of 10-Dec-1995).)
  132.     
  133.     
  134.     Later, I got Turbo Pascal for Windows.  (At that time I had a 16 mHz
  135.     386sx clone and MS-Windows 3.0)  I adapted the Pascal program to work
  136.     with the ObjectWindows framework.  This version does not properly set
  137.     check marks or greyed-out choices in menus;  it does not have "buttons"
  138.     -- instead you click with different mouse buttons to get different
  139.     actions.  (I had not learned all the Windows resources yet.)
  140.     
  141.     This version also added double size boards (16x16 and 20x20).  The
  142.     mid-game becomes a major part of the game with these.
  143.     
  144.     
  145.     In the summer of 1991, I bought Visual Basic -- because a magazine
  146.     reviewer claimed it was as significant as Turbo Pascal v3.0 had been
  147.     in 1984.  He was right.
  148.     
  149.     I visually drew my game form, and added chuncks of action code.
  150.     Then I imported pieces of Pascal, and manually adapted syntax
  151.     (while hiding indoors, with lots of Labatts, from the heat wave).
  152.     A few END IF bracketing errors caused some bugs, but not many.  The
  153.     incremental compiler feature IS BEAUTIFUL in finding and fixing these
  154.     in the middle of a game.
  155.     
  156.     Visual Basic made adding the buttons, check marks, and grey-outs easy.
  157.         
  158.     
  159.     Enjoy the game,
  160.     -- Rick
  161.  
  162.